import Vue from 'vue'
import Vuex from 'vuex'
import getters from './getters'
import app from './modules/app'
import permission from './modules/permission'
import settings from './modules/settings'
import user from './modules/user'
import message from './modules/message'
import operationLog from './modules/operation-log'
import warehouse from './modules/warehouse'

Vue.use(Vuex)

const store = new Vuex.Store({
  // data
  state: {
    rightList:[]
  },
  // 同步方法
  mutations: {
    setRightList(state,data) {
      state.rightList = data
    }
  },

  modules: {
    app,
    permission,
    settings,
    user,
    message,
    operationLog,
    warehouse
  },
  // 计算方法
  getters
})

export default store
